Powershell安装 |
您所在的位置:网站首页 › 不能使用名称 请尝试使用字符较少 › Powershell安装 |
我很难安装/更新我的powershell模块。当我尝试安装DBA工具时,我注意到了这一点。参考链接是https://dbatools.io/download/和https://github.com/sqlcollaborative/dbatools。 这是公司的个人电脑。但我知道我以前也安装过其他模块。有人知道这是怎么回事吗? PS (行政)> Install-Module DBATools 注意:安装模块命令在命令返回警告消息之前暂停了许多分钟。警告:无法解析包源“https://www.powershellgallery.com/api/v2'”。错误:"PackageManagement\Install-Package :未找到指定搜索条件和模块名称‘PowerShellGet’的匹配“。 Update-Module PowerShellGet 错误:“更新-模块:模块'PowerShellGet‘没有安装使用installed,所以它不能更新。” Update-Module PowerShellGet -Force 错误:“更新-模块:模块'PowerShellGet‘没有安装使用installed,所以它不能更新。” Find-Module dbatools 注意:在命令返回错误消息之前,Find-Module命令暂停了许多分钟。错误:“未找到指定搜索条件和模块名称'dbatools‘的匹配。请尝试Get-PSRepository查看所有可用的注册模块存储库。” Get-PSRepository | fl * 名称: PSGallery SourceLocation:https://www.powershellgallery.com/api/v2 可信:假 注册:真 InstallationPolicy :不可信 PackageManagementProvider : NuGet PublishLocation:https://www.powershellgallery.com/api/v2/package/ ScriptSourceLocation:https://www.powershellgallery.com/api/v2/items/psscript ScriptPublishLocation:https://www.powershellgallery.com/api/v2/package/ ProviderOptions:{} Get-Module PackageManagement -ListAvailable 目录: C:\Program \WindowsPowerShell\Modules ModuleType版本名ExportedCommands PackageManagement {Find-Package,Get-Package,Get-PackageProvider,Get-Packa. PackageManagement {Find-Package,Get-Package,Get-PackageProvider,Get-Packa. 代码语言:javascript复制Get-Module -ListAvailable | Where-Object ModuleBase -like $env:ProgramFiles\WindowsPowerShell\Modules\* | Sort-Object -Property Name, Version -Descending | Get-Unique -PipelineVariable Module | ForEach-Object { if (-not(Test-Path -Path "$($_.ModuleBase)\PSGetModuleInfo.xml")) { Find-Module -Name $_.Name -OutVariable Repo -ErrorAction SilentlyContinue | Compare-Object -ReferenceObject $_ -Property Name, Version | Where-Object SideIndicator -eq '=>' | Select-Object -Property Name, Version, @{label='Repository';expression={$Repo.Repository}}, @{label='InstalledVersion';expression={$Module.Version}} } }警告:无法解析包源“https://www.powershellgallery.com/api/v2'”。警告:无法解析包源“https://www.powershellgallery.com/api/v2'”。警告:无法解析包源“https://www.powershellgallery.com/api/v2'”。警告:无法解析包源“https://www.powershellgallery.com/api/v2'”。警告:无法解析包源“https://www.powershellgallery.com/api/v2'”。 代码语言:javascript复制$webclient=New-Object System.Net.WebClient $webclient.Proxy.Credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials [Net.ServicePointManager]::SecurityProtocol = "tls12" Find-Module dbatools警告:无法解析包源“https://www.powershellgallery.com/api/v2'”。 PackageManagement\Find-Package :未找到指定搜索条件和模块名称“dbatools”的匹配。尝试Get-PSRepository来查看所有可用的注册模块存储库。 Invoke-WebRequest https://www.powershellgallery.com/api/v2 Invoke-WebRequest :底层连接被关闭:连接意外关闭。 一些我尝试过的参考资料, windows 10 - Powershell不会使用安装模块安装几乎任何模块-堆栈溢出Powershell不会使用install -模块安装几乎任何模块。。 有这样一个脚本:Install无法解析包源代码'https //www.powershell Gallery.com/api/v2/‘https://vanbrenk.blogspot.com/2017/09/install-module-unable-to-resolve.html 从PowerShell库手动安装PowerShell模块- Mike https://mikefrobbins.com/2016/06/09/update-manually-installed-powershell-modules-from-the-powershell-gallery/ 更新模块:没有使用installed安装模块'PowershellGet‘,因此不能更新它。- Evotec https://evotec.xyz/update-module-module-powershellget-was-not-installed-by-using-install-module-so-it-cannot-be-updated/ |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |